//https://blog.csdn.net/zl1zl2zl3/article/details/81357146
import React, {
	PureComponent,
	Fragment
} from 'react';
import { connect } from 'dva';
import moment from 'moment';
import router from 'umi/router';
import { getNodeByNameAndCallbackProcess } from '@/components/_utils/algorithmTools';
import {
	Row,
	Col,
	Card,
	Form,
	Input,
	Select,
	Icon,
	Button,
	Modal,
	message,
	Divider,
	Table,
	DatePicker,
	Steps,
	Dropdown,
	Menu,
	Drawer,
  Tabs
} from 'antd';
//import StandardTable from '@/components/StandardTable';
import SelectPoliceRankTree from '@/components/SelectPoliceRankTree';
import SelectDutyLevelTree from '@/components/SelectDutyLevelTree';
import SelectWorkTree from '@/components/SelectWorkTree';
import SelectChangeTypeTree from '@/components/SelectChangeTypeTree';
import PageHeaderWrapper from '@/components/PageHeaderWrapper';

import CheckModal from './CheckModal';//审核不通过
import ApplicationModal from './ApplicationModal';//查看请示
import MemberApproveModal from './MemberApproveModal';//查看审批表


import styles from './ProUserList.less';
import {getValue} from '@/utils/globalcommon';
import {initTotalList} from '@/utils/globalcommon';
const FormItem = Form.Item;
const { Option } = Select;
const { confirm } = Modal;
const { Step } = Steps;
const { TabPane } = Tabs;

//用户列表

class StandardTable extends PureComponent {

  constructor(props) {
    super(props);
    const { columns } = props;
    const needTotalList = initTotalList(columns);

    this.state = {
      selectedRowKeys: [],
      needTotalList,
    };
  }

  static getDerivedStateFromProps(nextProps) {
    // clean state
    if (nextProps.selectedRows.length === 0) {
      const needTotalList = initTotalList(nextProps.columns);
      return {
        selectedRowKeys: [],
        needTotalList,
      };
    }
    return null;
  }

  handleRowSelectChange = (selectedRowKeys, selectedRows) => {
    let { needTotalList } = this.state;
    needTotalList = needTotalList.map(item => ({
      ...item,
      total: selectedRows.reduce((sum, val) => sum + parseFloat(val[item.dataIndex], 10), 0),
    }));
    const { onSelectRow } = this.props;
    if (onSelectRow) {
      onSelectRow(selectedRows);
    }

    this.setState({ selectedRowKeys, needTotalList });
  };

  handleTableChange = (pagination, filters, sorter) => {
    const { onChange } = this.props;
    if (onChange) {
      onChange(pagination, filters, sorter);
    }
  };

  cleanSelectedKeys = () => {
    this.handleRowSelectChange([], []);
  };

  render() {
    const { selectedRowKeys, needTotalList } = this.state;
    const { data = {}, rowKey, ...rest } = this.props;
    const { list = [], pagination } = data;

    const paginationProps = {
      showSizeChanger: true,
      showQuickJumper: true,
      current:pagination? pagination.currentPage : 1,
      ...pagination,
    };

    const rowSelection = {
      selectedRowKeys,
      onChange: this.handleRowSelectChange,
      getCheckboxProps: record => ({
        disabled: record.disabled,
      }),
    };

    return (
      <div className={styles.standardTable}>
        <Table
          rowKey={rowKey || 'key'}
          rowSelection={rowSelection}
          dataSource={data}
          pagination={paginationProps}
          onChange={this.handleTableChange}
          {...rest}
          size="middle"
          scroll={{x: 'max-content'}}
        />
      </div>
    );
  }
}

//上报单位列表
class StandardTableByReportCompany extends PureComponent {

  constructor(props) {
    super(props);
    const { columns } = props;
    const needTotalList = initTotalList(columns);

    this.state = {
      selectedRowKeys: [],
      needTotalList,
    };
  }

  static getDerivedStateFromProps(nextProps) {
    // clean state
    if (nextProps.selectedRows.length === 0) {
      const needTotalList = initTotalList(nextProps.columns);
      return {
        selectedRowKeys: [],
        needTotalList,
      };
    }
    return null;
  }

  handleRowSelectChange = (selectedRowKeys, selectedRows) => {
    let { needTotalList } = this.state;
    needTotalList = needTotalList.map(item => ({
      ...item,
      total: selectedRows.reduce((sum, val) => sum + parseFloat(val[item.dataIndex], 10), 0),
    }));
    const { onSelectRow } = this.props;
    if (onSelectRow) {
      onSelectRow(selectedRows);
    }

    this.setState({ selectedRowKeys, needTotalList });
  };

  handleTableChange = (pagination, filters, sorter) => {
    const { onChange } = this.props;
    if (onChange) {
      onChange(pagination, filters, sorter);
    }
  };

  cleanSelectedKeys = () => {
    this.handleRowSelectChange([], []);
  };

  render() {
    const { selectedRowKeys, needTotalList } = this.state;
    const { data = {}, rowKey, ...rest } = this.props;
    const { list = [], pagination } = data;

    const paginationProps = {
      showSizeChanger: true,
      showQuickJumper: true,
      current:pagination? pagination.currentPage : 1,
      ...pagination,
    };

    const rowSelection = {
    	type: 'radio',
      selectedRowKeys,
      onChange: this.handleRowSelectChange,
      getCheckboxProps: record => ({
        disabled: record.disabled,
      }),
    };

    return (
      <div className={styles.standardTable}>
        <Table
          rowKey={rowKey || 'key'}
          rowSelection={rowSelection}
          dataSource={list}
          pagination={paginationProps}
          onChange={this.handleTableChange}
          {...rest}
          size="middle"
          scroll={{x: 'max-content'}}
        />
      </div>
    );
  }
}

/* eslint react/no-multi-comp:0 */
@connect(({
	datacollect,
	loading
}) => ({
	datacollect,
	loading: loading.models.datacollect,
}))

@Form.create()
class ProReceiveSumList extends PureComponent {
	state = {
		modalVisible: false,
		updateModalVisible: false,
		viewModalVisible: false,
		expandForm: false,
		selectedRows: [],
		selectedRowsByReportCompany: [],
		formValues: {},
		updateFormValues: {},
		viewFormValues: {},
		requestModelName:"datacollect",
		currentPage: 1,
		pageSize: 10,

		current: 0,
		modalVisibleBySystemSelect: false,
		modalVisibleByNoCheck: false,
		modalVisibleByApplication: false,
		modalVisibleByMemberApprove: false,
		modalByCheck: false,

		leftMenuVisble: false,
    queryId: "",
	};

	//查看审批表
	handleModalVisibleByMemberApprove = flag => {
			this.setState({
				modalVisibleByMemberApprove: !!flag,
			});

	};

	//查看请示
	handleModalVisibleByApplication = flag => {
			this.setState({
				modalVisibleByApplication: !!flag,
			});
	};

	//数据校验
	handleModalVisibleByDataCheck = flag => {
		const { selectedRows } = this.state;
		const _this = this;
		if(selectedRows.length > 0) {
			if(selectedRows.length > 2) {

			}else {
				Modal.success({
				    title: '校验成功',
				    okText: '确认',
				    centered: true,
				    onOk() {

				    },
				    onCancel() {},
				});
			}
		}else {
			Modal.warning({
			    title: '请选择人员',
			    okText: '确认',
			    centered: true,
			});
		}

	};

	//审核通过
	handleModalVisibleByCheckPass = flag => {
		const { selectedRows,queryId } = this.state;
		const _this = this;
    const { dispatch } = this.props;
		if(selectedRows.length > 0) {
        Modal.success({
            title: '审核已通过',
            okText: '确认',
            centered: true,
            onOk() {

            },
            onCancel() {},
        });
        dispatch({
        	type: 'datacollect/query_page_for_policeselect',
          payload: {
              status: 1,
              id: queryId
          }
        });
		}else {
			Modal.warning({
			    title: '请选择人员',
			    okText: '确认',
			    centered: true,
			});
		}

	};

	//审核不通过
	handleModalVisibleByCheckNoPass = flag => {
		const { selectedRows,queryId } = this.state;
    console.log(queryId);
		const _this = this;
    const { dispatch } = this.props;

		if(selectedRows.length > 0) {
      this.handleModalVisibleByNoCheck(true);
      dispatch({
      	type: 'datacollect/query_page_for_policeselect',
        payload: {
            status: 1,
            status2: 0,
            id: queryId
        }
      });
        // Modal.success({
        //     title: '操作成功',
        //     content: '审核已被否定',
        //     okText: '确认',
        //     centered: true,
        //     onOk() {

        //     },
        //     onCancel() {},
        // });
		}else {
			Modal.warning({
			    title: '请选择人员',
			    okText: '确认',
			    centered: true,
			});
		}

	};
  //审核不通过弹窗
  handleModalVisibleByNoCheck = flag => {
  	const { selectedRows } = this.state;
  	if(selectedRows.length > 0) {
  		this.setState({
  			modalVisibleByNoCheck: !!flag,
  		});
  	}else {
  		Modal.warning({
  		    title: '请选择记录',
  		    okText: '确认',
  		    centered: true,
  		});
  	}
  };

  handleAddByNoCheck = (fieldsValue) => {
  	const { dispatch } = this.props;
    dispatch({
    	type: 'datacollect/query_page_for_policeselect',
      payload: {
          status: 1,
          status2: 0,
          checkdes: fieldsValue.check_des,
          id: this.state.queryId
      }
    });
  	message.success('保存成功');

  	this.handleModalVisibleByNoCheck();

  };

	columns = [
        {
	        title: '序号',
	        dataIndex: 'serial_number',
	        key: 'serial_number',
        }, {
	        title: '姓名',
	        dataIndex: 'name',
	        key: 'name',
        },  {
	        title: '性别',
	        dataIndex: 'sex',
	        key: 'sex',
        },  {
	        title: '出生日期',
	        dataIndex: 'date_of_birth',
	        key: 'date_of_birth',
        }, {
	        title: '审核状态',
	        dataIndex: 'status',
	        key: 'status',
          render: (text,record) => {
            if(record.status == 1) {
              return <span style={{color: 'green'}}>审核通过</span>
            }else if(record.status == 0) {
              return <span style={{color: 'red'}}>审核失败</span>
            }else {
              return <span>待审核</span>
            }
          }
        }, {
	        title: '审核描述',
	        dataIndex: 'check_des',
	        key: 'check_des',
          width: 160
        }, {
	        title: '职务',
	        dataIndex: 'post',
	        key: 'post',
        }, {
	        title: '职务层次',
	        dataIndex: 'duty_level',
	        key: 'duty_level',
        },{
	        title: '变动类型',
	        dataIndex: 'change_type',
	        key: 'change_type',
        },{
	        title: '现任警衔',
	        dataIndex: 'incumbent_police_rank',
	        key: 'incumbent_police_rank',
        },{
	        title: '现任警衔起算日期',
	        dataIndex: 'start_time',
	        key: 'start_time',
        },{
	        title: '拟授警衔',
	        dataIndex: 'police_rank',
	        key: 'police_rank',
        },{
	        title: '新警衔起算日期',
	        dataIndex: 'new_start_time',
	        key: 'new_start_time',
        },{
					title: '操作',
					fixed:'right',
					align: 'center',
		    	width: 160,
					render: (text, record) => {
			        	const { updateButtonVisible,deleteButtonVisible } = this.state;
			        	return (
				        	<Fragment>
					      <a onClick={() => this.handleModalVisibleByApplication(true)} style={{display: 'inline-block',padding: '5px 0'}}>查看请示</a>
								<Divider type="vertical" />
						    <a onClick={() => this.handleModalVisibleByMemberApprove(true)}>查看审批表</a>
								{/*<a onClick={() => this.handleViewModalVisible(true, record)}>查看</a>
								<Divider type="vertical" />
								<Button  type="primary"  icon="eye"  style={{marginRight: '5px'}} onClick={() => router.push('/policerank/viewstaff')}></Button>
								<Divider type="vertical" />
								<Button  type="danger" icon="delete" onClick={() => this.handleDeleteRecord(record)}></Button>*/}

						    </Fragment>
			        	);

					}
				},
	];

	columnsByReportCompany = [
        {
	        title: '单位名称',
	        dataIndex: 'company_name',
	        key: 'company_name',
        },  {
	        title: '人数',
	        dataIndex: 'person_num',
	        key: 'unit',
        }, 	{
	        title: '上报时间',
	        dataIndex: 'report_time',
	        key: 'report_time',
        },
	];

	columnsByCheck = [
		{
	        title: '序号',
	        dataIndex: 'index',
	        key: 'index',
        },  {
	        title: '姓名',
	        dataIndex: 'name',
	        key: 'name',
        }, 	{
	        title: '核查结果',
	        dataIndex: 'check_result',
	        key: 'check_result',
        },
	];

	componentDidMount() {
		const { dispatch } = this.props;
		dispatch({
			type: 'datacollect/query_page_for_policeselect',
		});
		dispatch({
			type: 'datacollect/query_page_for_reportcompany',
		});
	}

	handleStandardTableChange = (pagination, filtersArg, sorter) => {
		const { dispatch } = this.props;
		const { formValues } = this.state;

		this.setState({
			currentPage: pagination.current,
			pageSize: pagination.pageSize,
			selectedRows: [],
		})

		const filters = Object.keys(filtersArg).reduce((obj, key) => {
			const newObj = { ...obj
			};
			newObj[key] = getValue(filtersArg[key]);
			return newObj;
		}, {});

		const params = {
			currentPage: pagination.current,
			pageSize: pagination.pageSize,
			...formValues,
			...filters,
		};
		if(sorter.field) {
			params.sorter = `${sorter.field}_${sorter.order}`;
		}

		dispatch({
			type: 'datacollect/query_page_for_policeselect',
			payload: params,
		});
	};

	previewItem = id => {
		router.push(`/profile/basic/${id}`);
	};

	handleFormReset = () => {
		const { form,dispatch } = this.props;
		form.resetFields();
		this.setState({
				formValues: {},
				currentPage:1,
				selectedRows: [],
		});
		dispatch({
			type: 'datacollect/query_page_for_policeselect',
		});
	};

	toggleForm = () => {
		const { expandForm } = this.state;
		this.setState({
			expandForm: !expandForm,
		});
	};

	//选中人员
	handleSelectRows = rows => {
		this.setState({
			selectedRows: rows,
		});
	};

	//通过单位查询人员
	handleSelectRowsByReportCompany = rows => {
		console.log(rows);
		this.setState({
			selectedRowsByReportCompany: rows,
      queryId: rows[0].id
		});
		const { dispatch } = this.props;
		dispatch({
			type: 'datacollect/query_page_for_policeselect',
      payload: {
         id: rows[0].id
      }
		});
	};

	handleSearch = e => {
		e.preventDefault();

		const {
			dispatch,
			form
		} = this.props;

		form.validateFields((err, fieldsValue) => {
			if(err) return;

			const values = {
				...fieldsValue,
				updatedAt: fieldsValue.updatedAt && fieldsValue.updatedAt.valueOf(),
			};

			this.setState({
				currentPage:1,
				selectedRows: [],
				formValues: values,
			});

			dispatch({
				type: 'datacollect/query_page_for_policeselect',
				payload: values,
			});
		});
	};

	handleModalVisible = flag => {
		this.setState({
			modalVisible: !!flag,
		});
	};

	handleUpdateModalVisible = (flag, record) => {
		this.setState({
			updateModalVisible: !!flag,
			updateFormValues: record || {},
		});
	};

	handleViewModalVisible = (flag, record) => {
		this.setState({
			viewModalVisible: !!flag,
			viewFormValues: record || {},
		});
	};

	handleAdd = fields => {
		const { dispatch } = this.props;

		dispatch({
			type: 'prouser/insert_for_prouser',
			payload: {
				user_name: fields.user_name,
				user_name_cn: fields.user_name_cn,
				password: fields.password,
				email: fields.email,
				phone: fields.phone,
				auth_ids: fields.auth_ids,
				dept_id: fields.dept_id,
				dept: fields.dept,
				post_id: fields.post_id,
				post_name: fields.post_name,
				enabled: fields.enabled,

				is_system_user: fields.is_system_user,
				creator_id: fields.creator_id,
				inner_dept_code: fields.inner_dept_code,
				org_code: fields.org_code,
				org: fields.org,
				inner_org_code: fields.inner_org_code,
				memos: fields.memos,
				avatar: fields.avatar,
				job: fields.job,
				createTime: fields.createTime,
			},
			callback:(res) => {
	        	if(res.success) {
					message.success('添加成功');
	        	}else {
        			message.success('添加失败');
	        	}
  			}
		});

		this.setState({
				selectedRows: [],
		});

		this.handleModalVisible();

	};


	handleUpdate = fields => {

		const { dispatch } = this.props;
		const { currentPage,pageSize } = this.state;
		dispatch({
			type: 'prouser/update_for_prouser',
			payload: {
				user_id: fields.user_id,
				user_name: fields.user_name,
				user_name_cn: fields.user_name_cn,
				password: fields.password,
				email: fields.email,
				phone: fields.phone,
				auth_ids: fields.auth_ids,
				dept_id: fields.dept_id,
				dept: fields.dept,
				post_id: fields.post_id,
				post_name: fields.post_name,
				enabled: fields.enabled,
				currentPage,
        		pageSize
			},
			callback:(res) => {
	        	if(res.success) {
					message.success('修改成功');
	        	}else {
        			message.success('修改失败');
	        	}
      		}
		});

		this.setState({
			selectedRows: [],
		});

		this.handleUpdateModalVisible();

	};

	handleDeleteRecord = record => {
		const { dispatch } = this.props;
		const { currentPage,pageSize } = this.state;
		confirm({
	    title: '您确定要删除此人员吗?',
	    okText: '确认',
	    cancelText: '取消',
	    onOk() {

	    },
	    onCancel() {},
	  });

	  this.setState({
			selectedRows: [],
	   });

	};
	//拟授警衔
	selectedPoliceRankTreeValue = (deptRecord) => {
		  this.setState({
  			getPoliceRankTreeBySelectTree: deptRecord,
  		})
	}

	//职务层次
	selectedDutyLevelTreeValue = (deptRecord) => {
		  this.setState({
  			getDutyLevelTreeBySelectTree: deptRecord,
  		})
	}

	//单位
	selectedWorkTreeValue = (deptRecord) => {
		  this.setState({
  			getWorkTreeBySelectTree: deptRecord,
  		})
	}

	//变动类型
	selectedChangeTypeTreeValue = (deptRecord) => {
		  this.setState({
  			getChangeTypeTreeBySelectTree: deptRecord,
  		})
	}

	renderSimpleForm() {
		const {
			form: {
				getFieldDecorator
			},
			datacollect: {
				selectPoliceRankTree
			},
		} = this.props;
		const parentPoliceRankTreeMethod = {
			dispatch: this.props.dispatch,
			requestModelName: this.state.requestModelName,
			selectedPoliceRankTreeValue: this.selectedPoliceRankTreeValue,
			selectPoliceRankTree,
		}
		return(
		<Form onSubmit={this.handleSearch} layout="inline">
	      <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
				<Col md={8} sm={24}>
			        <FormItem label="姓名">
			        	{getFieldDecorator('user_name')(<Input placeholder="请输入" />)}
					</FormItem>
			    </Col>
		      	<Col md={8} sm={24}>
			        <FormItem label="拟授警衔">
			        	{getFieldDecorator('policerank')(<SelectPoliceRankTree  {...parentPoliceRankTreeMethod}/>)}
					</FormItem>
		    	</Col>
			    <Col md={8} sm={24}>
			        <span className={styles.submitButtons}>
			        <Button type="primary" htmlType="submit">
			        	查询
			        </Button>
			        <Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}>
			        	重置
			        </Button>
			        <a style={{ marginLeft: 8 }} onClick={this.toggleForm}>
			        	展开 <Icon type="down" />
			        </a>
			        </span>
		        </Col>
	        </Row>
        </Form>
		);
	}

	renderAdvancedForm() {
		const {
			form: {
				getFieldDecorator
			},
			datacollect: {
				selectPoliceRankTree,
				selectDutyLevelTree,
				selectWorkTree,
				selectChangeTypeTree,
			},
		} = this.props;
		const parentPoliceRankTreeMethod = {
			dispatch: this.props.dispatch,
			requestModelName: this.state.requestModelName,
			selectedPoliceRankTreeValue: this.selectedPoliceRankTreeValue,
			selectPoliceRankTree,
		}
		const parentDutyLevelTreeMethod = {
			dispatch: this.props.dispatch,
			requestModelName: this.state.requestModelName,
			selectedDutyLevelTreeValue: this.selectedDutyLevelTreeValue,
			selectDutyLevelTree,
		}
		const parentWorkTreeMethod = {
			dispatch: this.props.dispatch,
			requestModelName: this.state.requestModelName,
			selectedWorkTreeValue: this.selectedWorkTreeValue,
			selectWorkTree,
		}
		const parentChangeTypeTreeMethod = {
			dispatch: this.props.dispatch,
			requestModelName: this.state.requestModelName,
			selectedChangeTypeTreeValue: this.selectedChangeTypeTreeValue,
			selectChangeTypeTree,
		}
		return(
			<Form onSubmit={this.handleSearch} layout="inline">
		      <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
							<Col md={8} sm={24}>
						        <FormItem label="姓名">
						        	{getFieldDecorator('user_name')(<Input placeholder="请输入" />)}
								</FormItem>
						    </Col>
					      <Col md={8} sm={24}>
						        <FormItem label="拟授警衔">
						        	{getFieldDecorator('policerank')(<SelectPoliceRankTree  {...parentPoliceRankTreeMethod}/>)}
										</FormItem>
					    	</Col>
					      <Col md={8} sm={24}>
						        <FormItem label="职务层次">
						        	{getFieldDecorator('dutylevel')(<SelectDutyLevelTree  {...parentDutyLevelTreeMethod}/>)}
										</FormItem>
					    	</Col>
		    	</Row>
		      <Row gutter={{ md: 8, lg: 24, xl: 48 }}>
				      <Col md={8} sm={24}>
						        <FormItem label="单位">
						        	{getFieldDecorator('work')(<SelectWorkTree  {...parentWorkTreeMethod}/>)}
										</FormItem>
					    	</Col>
				      <Col md={8} sm={24}>
						        <FormItem label="变动类型">
						        	{getFieldDecorator('changetype')(<SelectChangeTypeTree  {...parentChangeTypeTreeMethod}/>)}
										</FormItem>
					    	</Col>
					    <Col md={8} sm={24}>
				        <FormItem label="核查状态">
				            {getFieldDecorator('check_status')(
				                <Select placeholder="请选择" style={{ width: '100%' }}>
				                    <Option value="1">通过</Option>
				                    <Option value="0">不通过</Option>
				                </Select>
				            )}
				        </FormItem>
			        </Col>
		    	</Row>
			    <div style={{ overflow: 'hidden' }}>
					<div style={{ marginBottom: 24 }}>
					<Button type="primary" htmlType="submit">
			        查询
			        </Button>
			        <Button style={{ marginLeft: 8 }} onClick={this.handleFormReset}>
			        重置
			        </Button>
			        <a style={{ marginLeft: 8 }} onClick={this.toggleForm}>
			        收起 <Icon type="up" />
			        </a>
		        	</div>
		        </div>
        </Form>
		);
	}

	renderForm() {
		const {
			expandForm
		} = this.state;

		return expandForm ? this.renderAdvancedForm() : this.renderSimpleForm();
	}


	//左侧列表隐藏
	toggle = () => {
	    this.setState({
	    	leftMenuVisble: !this.state.leftMenuVisble
	    })
  	};

	render() {
		const steps = [
		  {
		    title: '系统筛选',
		  },
		  {
		    title: '核查',
		  },
		  {
		    title: '录入鉴定信息',
		  },
		  {
		    title: '生成',
		  },
		  {
		    title: '确定人员',
		  },
		];
		const {
			datacollect: {
				data,
				dataByReport,
				selectDeptTree,
				selectOrganTree,
				selectStaffStatusTree,
				authForUser,
				postForUser
			},
			loading,
		} = this.props;
		const {
			selectedRows,
			selectedRowsByReportCompany,
			modalVisible,
			updateModalVisible,
			viewModalVisible,
			updateFormValues,
			viewFormValues,
			addButtonVisible,

			current,
			modalVisibleByNoCheck,
      modalVisibleByApplication,
      modalVisibleByMemberApprove,
			modalByCheck,
			leftMenuVisble
		} = this.state;


		const dataByCheckResult = [
		  {
		    key: '1',
		    index: '1',
		    name: '李某',
		    check_result: '文化程度;没有培训;不一致',
		  },
		];


		//审核不通过
		const parentMethodsByNoCheck = {
			handleModalVisibleByNoCheck: this.handleModalVisibleByNoCheck,
			handleAddByNoCheck: this.handleAddByNoCheck,
			modalVisibleByNoCheck
		};

		//查看请示
		const parentMethodsByApplication = {
			handleModalVisibleByApplication: this.handleModalVisibleByApplication,
			modalVisibleByApplication
		};

		//查看审批表
		const parentMethodsByMemberApprove = {
			handleModalVisibleByMemberApprove: this.handleModalVisibleByMemberApprove,
			modalVisibleByMemberApprove
		};

		const menuCreate = (
		  <Menu>
		    <Menu.Item key="1" onClick={() => this.handleModalVisibleByCheckPass(true)}>
		      	审核通过
		    </Menu.Item>
		    <Menu.Item key="2" onClick={() => this.handleModalVisibleByCheckNoPass(true)}>
		   			审核不通过
		    </Menu.Item>
		  </Menu>
		);

		return(
			<PageHeaderWrapper title="接收汇总列表">
			<span className={styles.togglePic} onClick={this.toggle}>
	          <Icon type={ leftMenuVisble? 'menu-fold' : 'menu-unfold'} />
	        </span>
	        <div className={leftMenuVisble?styles.leftMenuContainerShow:styles.leftMenuContainerHide}>
				<Drawer
		          placement="left"
		          closable={false}
		          visible={leftMenuVisble}
		          getContainer={false}
		          mask={false}
		          width='100%'
		          className={leftMenuVisble?styles.leftDrawerShow:styles.leftDrawerHide}
		        >
					<Card bordered={false} style={{width: '100%',height: '850px'}}>

					   <StandardTableByReportCompany
				        rowKey={"user_id"}
				        selectedRows={selectedRowsByReportCompany}
				        loading={loading}
				        data={dataByReport}
				        columns={this.columnsByReportCompany}
				        onSelectRow={this.handleSelectRowsByReportCompany}
				        onChange={this.handleStandardTableChange}
				        />
		            </Card>
		        </Drawer>
	       	</div>
            <Card bordered={false} className={leftMenuVisble? styles.rightBaseInfoListSection:styles.rightBaseInfoListAll}>
            <div className={styles.proUsertableList}>
            <div className={styles.proUsertableListForm}>{this.renderForm()}</div>
            <div className={styles.proUsertableListOperator}>
        	{/*<Button icon="plus" type="primary" onClick={() => this.handleModalVisible(true)}>
    		新增
    		</Button>*/}
        	    {/*<Steps current={current} size="small" style={{width: '80%',marginBottom: '30px',marginTop: '10px'}}>
		          {steps.map(item => (
		            <Step key={item.title} title={item.title} />
		          ))}
		        </Steps>*/}
        	<Button type="primary" onClick={() => this.handleModalVisibleByDataCheck(true)} style={{marginRight: '25px'}}>
    				数据校验
    		</Button>
    		<Dropdown overlay={menuCreate}>
		      <Button type="primary">
		        	审核<Icon type="down" />
		      </Button>
		    </Dropdown>
		    {/*<Button type="primary" onClick={() => this.handleModalVisibleByApplication(true)} style={{marginLeft: '20px'}}>
    				查看请示
    		</Button>
    		<Button type="primary" onClick={() => this.handleModalVisibleByMemberApprove(true)} style={{marginLeft: '20px'}}>
    				查看审批表
    		</Button>*/}
    	</div>
      {data.list.length > 0?(
        <Tabs type="card">
          {data.list.map(item => {
            return (
              <TabPane tab={item.title} key={item.key} closable={item.closable}>
              <StandardTable
                rowKey={"user_id"}
                selectedRows={selectedRows}
                loading={loading}
                data={item.children}
                columns={this.columns}
                onSelectRow={this.handleSelectRows}
                onChange={this.handleStandardTableChange}
                />
              </TabPane>
            )
          })}

          </Tabs>
      ):(
          <StandardTable
          rowKey={"user_id"}
          selectedRows={selectedRows}
          loading={loading}
          data={[]}
          columns={this.columns}
          onSelectRow={this.handleSelectRows}
          onChange={this.handleStandardTableChange}
          />
      )}
        </div>
        </Card>

        <ApplicationModal {...parentMethodsByApplication}/>
        <MemberApproveModal {...parentMethodsByMemberApprove}/>
        <CheckModal {...parentMethodsByNoCheck}/>

    </PageHeaderWrapper>
		);
	}
}

export default ProReceiveSumList;
